<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="btn">button</button>
    <script>
        const btn = document.getElementById("btn");
        var temp;
        let arr  = []
        btn.onclick = function(){
            let ul = document.createElement("ul")
            for(let i = 0; i < 100000; i++) {
                ul.appendChild(document.createElement("li"))
            }
            temp = ul;
            //arr.push(new Array(1000000).join('x'))
        }
    </script>
</body>
</html>